<!DOCTYPE HTML>
<html>
	<head>
		<title>万家后台管理</title>
		{{template "inc/mate.html" .}}
	    {{template "inc/easyui_css.html" .}}
	    {{template "inc/ie_supper.html" .}}
	</head>
	<body class="easyui-layout">
		<div data-options="region:'north'" style="height:50px">
			<h2 style="margin: 0px; margin-left: 20px; line-height: 50px;">万家后台</h2>
		</div>
		<div data-options="region:'west'" title="功能菜单" style="width:165px;">
			<div class="easyui-accordion" style="width:100%;">
		        {{if .LoginInfo.MenuAuths}}
		        {{range $i,$j:=.LoginInfo.MenuAuths}}
		        	{{with $TmpVal1:=c2int $j.AuthShowStatus}}
		        	{{else}}
		        		{{with $TmpVal2:=c2int $j.AuthPreId}}
		        		{{else}}
			        		<div title="{{$j.AuthName}}" style="padding:0px; margin: 0px;">
			        			<ul class="easyui-tree">
			        				{{range $k,$v:=$.LoginInfo.MenuAuths}}
			        					{{if eq $v.AuthPreId $j.AuthId}}
			        						{{with $TmpVal3:=c2int $v.AuthShowStatus}}
		        							{{else}}
				        						{{if $v.AuthUrl}}
				        							<li><a style="color:#595959;text-decoration: none;" href="javascript:addTab('{{$v.AuthUrl}}','{{$v.AuthName}}');">{{$v.AuthName}}</a></li>
				        						{{else}}
				        							<li><a style="color:#595959;text-decoration: none;" href="javascript:addTab('','');">{{$v.AuthName}}</a></li>
				        						{{end}}
			        						{{end}}
			        					{{end}}
			        				{{end}}
			        			</ul>
			        		</div>
						{{end}}
					{{end}}
		        {{end}}
		        {{end}}
			</div>
		</div>
		<div data-options="region:'center'">
			<div id="contab" class="easyui-tabs" data-options="plain:true" style="width:100%;height:100%">

				<div title="About" style="padding:10px">
		            <p style="font-size:14px">jQuery EasyUI framework helps you build your web pages easily.</p>
		            <ul>
		                <li>easyui is a collection of user-interface plugin based on jQuery.</li>
		                <li>easyui provides essential functionality for building modem, interactive, javascript applications.</li>
		                <li>using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.</li>
		                <li>complete framework for HTML5 web page.</li>
		                <li>easyui save your time and scales while developing your products.</li>
		                <li>easyui is very easy but powerful.</li>
		            </ul>
		        </div>

    		</div>
		</div>
		<div data-options="region:'south'" style="height:25px; text-align: center;">
			技术支持：迷路的阿修罗
		</div>
	</body>
	{{template "inc/easyui_js.html" .}}
	<script type="text/javascript">
		function addTab(url,name){
			if (url==""||name=="") {
				return
			}
			if ($('#contab').tabs('exists',name)){
				$('#contab').tabs('select', name);
			}else{
				var allHeight=document.documentElement.clientHeight;
				var height=allHeight-114;
				$('#contab').tabs('add',{
	                title: name,
	                //href:url,
	                content:' <iframe scrolling="yes" frameborder="0"  src="'+url+'" style="width:100%;height:'+height+'px;"></iframe>',
	                closable: true
	            });
			}
		}
	</script>
</html>